package com.myschool.server.model;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "attendance")
public class Attendance extends BaseEntity {

	@ManyToOne(cascade = CascadeType.ALL)
	
	private User student;
	@Temporal(TemporalType.TIMESTAMP)
	private Date attendanceDate;
	@ManyToOne(cascade = CascadeType.ALL)
	private Section section;
	@ManyToOne(cascade = CascadeType.ALL)
	private Subject subject;
	
	@Column(name = "absentList", length = 500)
	private String absentList;
	
	@Column(name = "present")
	private Boolean isPresent;



	/**
	 * @return the section
	 */
	public Section getSection() {
		return section;
	}

	/**
	 * @param section
	 *            the section to set
	 */
	public void setSection(Section section) {
		this.section = section;
	}

	/**
	 * @return the subject
	 */
	public Subject getSubject() {
		return subject;
	}

	/**
	 * @param subject
	 *            the subject to set
	 */
	public void setSubject(Subject subject) {
		this.subject = subject;
	}

	/**
	 * @return the isPresent
	 */
	public Boolean getIsPresent() {
		return isPresent;
	}

	/**
	 * @param isPresent the isPresent to set
	 */
	public void setIsPresent(Boolean isPresent) {
		this.isPresent = isPresent;
	}

	/**
	 * @return the student
	 */
	public User getStudent() {
		return student;
	}

	/**
	 * @param student the student to set
	 */
	public void setStudent(User student) {
		this.student = student;
	}

	public String getAbsentList() {
		return absentList;
	}

	public void setAbsentList(String absentList) {
		this.absentList = absentList;
	}

	public Date getAttendanceDate() {
		return attendanceDate;
	}

	public void setAttendanceDate(Date attendanceDate) {
		this.attendanceDate = attendanceDate;
	}

}
